﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TienTeTuong
{
    public partial class SearchArticle : System.Web.UI.Page
    {
        public List<ArticleDTO> lstArticle = new List<ArticleDTO>();
        public string cateArtID;
        public string strPage;
        public int iTotalPage;
        public int iCurPage;
        public int iUpperPage;
        public int iLowerPage;
        public int iTotalResult;
        public int page;
        public string keyword;

        protected void Page_Load(object sender, EventArgs e)
        {
            string strPage = Request.QueryString["page"];
           keyword = Request.QueryString["keyword"];
            try
            {
                keyword = Common.convertToUnSign(keyword);
            }
            catch (Exception)
            {
                keyword = "";
            }
           

            page = Common.IsNumber(strPage) ? int.Parse(strPage) : 1;
            var articleBus = new ArticleBUS();
            lstArticle = articleBus.SearchArticleByPage(keyword, page, out iTotalPage, out iCurPage, out iLowerPage, out iUpperPage, out iTotalResult);
        }
    }
}